<?php

namespace app\queue\stomp;

use app\queue\BaseConsumer;
use common\service\FinanceService;

class CreateOrderSettlementChatConsumer extends BaseConsumer
{

    // 要消费的队列名
    public $queue = 'create_order_settlement_chat';

    // 连接名，对应 config/redis_queue.php 里的连接`
    public $connection = 'default';


    public function doConsume($data)
    {
        try {
            $financeService = new FinanceService();
            $financeService->createOrderFinanceChat($data['settlement_id']);
        } catch (\Throwable $e) {
            trace(format_exception_info($e), "ERR");
        }
    }
}
